<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <title>首页</title>
</head>
<body>
<h1>欢迎来到卡卡分享首页，你现在可以进行如下操作：</h1>
<a href="login">登录</a>
<a href="register">注册</a>

<h3>Users</h3>
<c:if test="${!empty userList}">
    <table class="data">
        <tr>
            <th>Name</th>
            <th>Password</th>
            <th>Age</th>
            <th>&nbsp;</th>
            <th>&nbsp;</th>
        </tr>
        <c:forEach items="${userList}" var="user">
            <tr>
                <td>${user.name}</td>
                <td>${user.password}</td>
                <td>${user.age}</td>
                <td><a href="users/delete/${user.id}">delete</a>
                </td>
                <td><a href="users/edit/${user.id}">edit</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</c:if>
</body>
</html>